﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HomeSite.Master" Inherits="System.Web.Mvc.ViewPage<TimeTableManagement.Entities.Tb_Slot>" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
<script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>

<% using (Html.BeginForm()) { %>
    <%: Html.ValidationSummary(true) %>
    
        <%: Html.HiddenFor(model => model.id) %>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.slot) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.slot) %>
            <%: Html.ValidationMessageFor(model => model.slot) %>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.from) %>
        </div>
        <div class="editor-field">
            <%--<%: Html.EditorFor(model => model.from) %>
            <%: Html.ValidationMessageFor(model => model.from) %>--%>
            <select id="from" name="from">
            <% int k = 530;  for (int i = 1; i < 34; i++)
                  {
                      if (i % 2 == 1)
                      {
                          k = k + 70;
                      }
                      else 
                      {
                          k = k + 30;                        
                      }
                   %>
                   <% if (k == Model.from)
                      {%>
                        <option selected=selected value=<%: k %>> <%: TimeTableManagement.Entities.Tb_Slot.getFrom(k)%></option>
                        <% }
                      else
                      { %>
                        <option  value=<%: k %>> <%: TimeTableManagement.Entities.Tb_Slot.getFrom(k)%></option>
                        <% } %>
                  <% } %>
            </select>   
                    

        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.to) %>
        </div>
        <div class="editor-field">
            <%--<%: Html.EditorFor(model => model.to) %>
            <%: Html.ValidationMessageFor(model => model.to) %>--%>
            <select id="to" name="to">
            <% int t = 530;  for (int i = 1; i < 34; i++)
                  {
                      if (i % 2 == 1)
                      {
                          t = t + 70;
                      }
                      else 
                      {
                          t = t + 30;                        
                      }
                   %>
                   <% if (t == Model.to)
                      {%>
                        <option selected=selected value=<%: t %>> <%: TimeTableManagement.Entities.Tb_Slot.getFrom(t)%></option>
                        <% }
                      else
                      { %>
                        <option  value=<%: t %>> <%: TimeTableManagement.Entities.Tb_Slot.getFrom(t)%></option>
                        <% } %>
                  <% } %>
            </select>
        </div>

        <div class="editor-label">
            <%: Html.LabelFor(model => model.note) %>
        </div>
        <div class="editor-field">
            <%: Html.EditorFor(model => model.note) %>
            <%: Html.ValidationMessageFor(model => model.note) %>
        </div>

        <p>
            <input id="submit" type="submit" value="Save" onclick="return checkingsubmit()" />
        </p>
<% } %>

<div>
    <%: Html.ActionLink("Back to List", "Index") %>
</div>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="leftmenu" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="menuright" runat="server">
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Footer" runat="server">
</asp:Content>
